import Vue from 'vue'
import VueRouter from 'vue-router'
import Laout from '@/views/laout/Index.vue'
import Login from '@/views/login/Index.vue'
import Home from '@/views/home/Home.vue'


const Project = () => import('@/views/project/Index.vue')
const List = () => import('@/views/project/list/Index.vue')
const Classification = () => import('@/views/project/classification/Index.vue')

const Order = () => import('@/views/order/Index.vue')
const Orderlist = () => import('@/views/order/orderlist/Index.vue')
const Summary = () => import('@/views/order/summary/Index.vue')

const Advertisement = () => import('@/views/advertisement/Index.vue')
const Advertisementlist = () => import('@/views/advertisement/list/Index.vue')
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Laout,
    children: [
      {
        path: '/',
        name: 'home',
        component: Home
      },
      {
        path: '/project',
        name: 'project',
        component: Project,
        children: [
          {
            path: 'list',
            name: 'list',
            component: List
          },
          {
            path: 'classification',
            name: 'classification',
            component: Classification
          },
        ]
      },
      {
        path: '/Order',
        name: 'Order',
        component: Order,
        children: [
          {
            path: 'Orderlist',
            name: 'Orderlist',
            component: Orderlist
          },
          {
            path: 'Summary',
            name: 'Summary',
            component: Summary
          },
        ]
      },
      {
        path: '/Advertisement',
        name: 'Advertisement',
        component: Advertisement,
        children: [
          {
            path: 'Advertisementlist',
            name: 'Advertisementlist',
            component: Advertisementlist
          },
        ]
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: Login,
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
